package com.dilidili.config;
 
import com.aliyun.oss.OSSClient;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <p>Title: 阿里云配置类</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2020</p>
 * <p>Company: http://www.ubisys.com.cn/</p>
 *
 * @Auther: cw
 * @Date: 2020/9/3 20:34
 */
@Configuration
@Data
public class OssConfig {
/*
aliyun:
  oss:
    #yourEndpoint填写Bucket所在地域对应的Endpoint，可在创建好的Bucket概况页查看。
    endpoint: oss-cn-beijing.aliyuncs.com		# 以成都为例，Endpoint填写为https://oss-cn-chengdu.aliyuncs.com
    #阿里云账号AccessKey拥有所有API的访问权限，风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维，请登录RAM控制台创建RAM用户
    accessKeyId: LTAI5tB1reMGjGnfwvnQoBwj			# 阿里云账号AccessKey里所对应的AccessKey ID
    accessKeySecret: tgYWiWa3z1GIix474LTBWVQEBRfGSY			# 阿里云账号AccessKey里所对应的AccessKey Secret
    bucketName: heibody
*/
    private String endpoint="oss-cn-beijing.aliyuncs.com";
    private String accessKeyId="LTAI5tC75qMkocBJyr41aH9R";
    private String accessKeySecret="ve9fALL09V0RowNOQx9pRwyqCUumcR";
    private String bucketName="jiangaibo";
    private String urlPrefix;
    @Bean
    public OSSClient oSSClient() {
        return new OSSClient(endpoint, accessKeyId, accessKeySecret);
    }
 
 
}